The present invention relates to error recovery processing used in a data storage device.
Devices using various types of media such as optical disks and magnetic tapes are known as data storage devices. Among them, hard disk drives (HDDs), which store data in magnetic disks, have become popular as storage devices for computers to such an extent that they are one of the storage devices indispensable for today's computer systems. Further, not limited to computers, these applications are spread, due to the superior characteristics, in a broader range including moving picture recording/reproducing devices, car navigation systems, and removable memories for digital cameras.
Each magnetic disk used in HDDs has a plurality of tracks formed concentrically. In each track, address information (servo information) and user data are stored. Accessing a desired area (sector) according to the address information by the magnetic head formed of a thin film element enables either data write to the sector or data read from the sector. A signal read out from a magnetic disk through data read operation is subjected to waveform shaping, decoding processing and other prescribed signal processing by a signal processing circuit before transmitted to a host. Data transmitted from the host is also subjected to prescribed processing by the signal processing circuit in like manner before being written to the magnetic disk.
If an error occurs during data write to or data read from the magnetic disk, ERP (Error Recovery Procedure) processing is executed. The ERP processing recovers the error by executing ERP steps stored beforehand corresponding to the error. Conditions of data write/data read are changed at each ERP step. Thus, the ERP processing performs the error recovery by repeating data write processing/data read processing under different conditions. The ERP processing is disclosed in, for example, patent document 1. In Japanese Patent Laid-open No. 10-161818, the following method for executing the ERP processing is disclosed as the prior art. This method will be described with reference to FIG. 6.
(1) A host system transmits a read command or a write command to a HDD. The HDD executes read processing or write processing according to the command.
(2) In the event that a read error or a write error occurs at a logical block address (LBA) “A”, a MPU successively executes ERP processing from an ERP step 1 through a HDC and a channel.
(3) In a system in which the length of time until time out is shorter than the execution time of all steps of the ERP processing (it is assumed that the number of steps is M), if the error is not recovered as a result of executing up to an ERP step K (<M), the MPU receives a reset command from the host system. Consequently, the ERP processing is stopped at the ERP step K, and then the HDD transmits a reset completion signal to the host.
(4) The host system transmits a retry command to the HDD, and the HDD then executes reread or rewrite in response to the retry command.
(5) In the event that a read error or a write error occurs again at the LBA “A”, the ERP processing is successively executed from the ERP step 1 again.
(6) Because the length of time until time out is usually constant in the system, if the error is not recovered as a result of executing up to the ERP step K, the MPU receives a reset command from the host system. Consequently, the ERP processing is stopped at the ERP step K, and then the HDD transmits a reset completion signal to the host.
In the above-mentioned method, the length of time until time out is shorter than the execution time of all steps of the ERP processing. In addition to it, at the time of retry, the ERP processing is executed from the ERP step 1 again. Therefore, the ERP steps (k+1) through M are not executed. Accordingly, even if between the ERP step (k+1) and M there is a step that is effective for a certain error, the step is not executed. Because of it, the possibility that the error will be recovered is low.
In order to solve this problem, the patent reference proposes that if the execution of the ERP processing is interrupted due to time out, at the time of retry the ERP processing is executed from a step subsequent to the ERP step that has been executed last. Restarting the ERP processing from the interrupted ERP step makes it possible to execute more unexecuted ERP steps, resulting in the increase in probability of error recovery.